<layout name='Layout/layout_page' />
    <ol class="breadcrumb">
        <li><a href="<{:U('Order/index')}>">Orders</a></li>
        <li class="active"><{:L(_public_list)}></li>
    </ol>
    
    <form class="form-inline" method="get" action="index.php">
      <div class="form-group">
        <label>Order Number</label>
        <input type="text" class="form-control input-sm" name="order_no">
      </div>
      <div class="form-group">
        <label>Date</label>
        <input type="text" name="startDate" id="startDate" class="form-control input-sm"> - <input type="text" name="endDate" id="endDate" class="form-control input-sm">
      </div>
      <script> 
    $(function(){
      $("#startDate" ).datepicker();    
      $("#endDate" ).datepicker();          
    });
    </script>
    <button type="submit" class="btn btn-default btn-sm">Search</button>
    <input type="hidden" name="m" value="Admin" />
    <input type="hidden" name="c" value="Order" />
    <input type="hidden" name="a" value="index" />
  </form>
  <p></p>
    
    <form id="ajaxForm" method="post" action="<{:U('Order/del')}>" name="form1" class="form-horizontal form-validata">
    <TABLE class="table table-striped table-bordered table-hover">
      <THEAD>
        <tr>
          <TH><input class="checkall" name="checkall" type="checkbox" id="checkall" onClick="CheckAll(this.form)"/> <{:L("_public_select")}></TH>
          <TH>Order Number</TH>
          <TH>MemberID</TH>
          <TH>Amount</TH>          
          <TH>Name</TH>
          <TH>Phone</TH>
          <TH>Email</TH>
          <TH>Status</TH>
          <TH>Treated</TH>
          <TH>Date</TH>
          <TH>Action</TH>
        </tr>
      </THEAD>
      <TBODY>             
            <volist name="list" id="vo">
            <tr>
              <td><eq name="vo.payStatus" value="0"><input type="checkbox" name="selectedids[]" value="<{$vo.id}>" id="<{$vo.id}>"> <{$vo.id}></eq></td>
              <td><{$vo.order_no}></td>       
              <td><{$vo.memberID}></td>
              <td><{$vo.money}></td>
              <td><{$vo.firstName}>.<{$vo.lastName}></td>   
              <td><{$vo.phone}></td>   
              <td><{$vo.email}></td>
              <td><eq name="vo.payStatus" value="0"><font color="red">Not paid</font><else/><font color="green">Already paid</font></eq></td>   
              <td>
              <eq name="vo.payStatus" value="1">
              <eq name="vo.status" value="0">
                <a href="<{:U('Order/change' , array('id'=>$vo['id'],'state'=>1))}>" class="btn btn-sm btn-danger">No</a>
              <else/>
                <a href="<{:U('Order/change' , array('id'=>$vo['id'],'state'=>0))}>" class="btn btn-sm btn-success">Yes</a>              
              </eq>
              </eq>
              </td><td><{$vo.createTime|date='Y-m-d H:i:s',###}></td>
              <td>
              <a href="<{:U('Order/view' , array('id'=>$vo['id']))}>" class="btn btn-default btn-sm">Detail</a>
              </td>
            </tr>
            </volist>
      </TBODY>
    </TABLE>

    <div class="row">
        <div class="col-md-6">
            <button class="btn btn-info btn-sm" onClick="if(!confirm('Cannot be recovered after deletion!'))return false;"><i class="glyphicon glyphicon-trash"></i> Delete selected message</button>
        </div>
        
        <div class="col-md-6">
            <div class="page">
                <nav>
                    <ul class="pagination"><{$page}></ul>
                </nav>
            </div>
        </div>
    </div>
    </form>

<input type="hidden" id="menu_action" value="goods" />